home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48_2 / yahtzee < prev    next >
Text File  |  1995-03-31  |  5KB  |  144 lines

  1. Article 1139 of comp.sys.handhelds:
  2. Path: en.ecn.purdue.edu!noose.ecn.purdue.edu!samsung!zaphod.mps.ohio-state.edu!wuarchive!mit-eddie!bloom-beacon!eru!hagbard!sunic!mcsun!hp4nl!charon!cwi.nl
  3. From: jurjen@cwi.nl (Jurjen NE Bos)
  4. Newsgroups: comp.sys.handhelds
  5. Subject: Yahtzee for HP[24]8
  6. Keywords: games
  7. Message-ID: <2039@charon.cwi.nl>
  8. Date: 31 Aug 90 08:01:16 GMT
  9. Sender: news@cwi.nl
  10. Organization: STORC, Veldhoven
  11. Lines: 129
  12.  
  13. -------------------------------------------------------------------------------
  14. This is a translation of an article, published by STORC. STORC (Stichting Ter
  15. Ondersteuning van RPL Calculators) is the Dutch support-group for the HP48SX,
  16. HP28S and HP28C. STORC publishes a (dutch) magazine, called "STORC
  17. Nieuwsbrief", 10 times a year.
  18.  
  19.     Our address:    STORC p.a. Christ van Willegen
  20.     Dordognelaan 45
  21.     5627 HB  Eindhoven
  22.     The Netherlands
  23. -------------------------------------------------------------------------------
  24.  
  25. As an extra service, here are equivalent programs for both the 28[SC] and 48SX.
  26. Of course, the 48 program is a little bit more advanced :-).  The programs
  27. simulates a set of dice for the game yahtzee.  This is very convenient if
  28. you're traveling, because real dice in an airplane are a pain :-).  I
  29. played hundreds of games using these programs, and found them good enough
  30. to use as a serious alternative to real dice (That's because those calculators
  31. have very high-quality random generator.  In fact it is better than I have
  32. ever seen on a big computer.  Nice work, guys.)
  33.  
  34. Happy playing!
  35.  
  36. This is the HP28 version.  You operate it by typing the numbers on the
  37. dice you want to fix, then press YTZ.  Example:
  38. YTZ gives 5 random dice
  39. 345 YTZ gives a 3, 4, 5, and two random dice.
  40. Note that cheating is very easy; you'd better watch the other party if he/she
  41. is busy.
  42.  
  43. YTZ:
  44. \<<
  45.   IF DEPTH
  46.   THEN {}
  47.     WHILE OVER
  48.     REPEAT OVER 10 MOD 1 \->LIST + SWAP 10 / IP SWAP
  49.     END SWAP DROP
  50.   ELSE {}
  51.   END
  52.   WHILE DUP SIZE 5 <
  53.   REPEAT RAND 6 * IP 1 + 1 \->LIST SWAP +
  54.   END
  55.   DSP
  56. \>>
  57.  
  58. DSP:
  59. \<< \-> l
  60.   \<< "" DUP DUP 1 l SIZE
  61.     FOR k {{1 3 1}{2 1 4}{2 3 4}{5 1 5}{5 3 5}{5 5 5}}
  62.       l k GET GET LIST\-> 1 SWAP
  63.       START {"   ""o  "" o ""  o""o o"} 4 ROLL GET 124 CHR + 4 ROLL +
  64.       NEXT
  65.     NEXT 1 3
  66.     FOR k 1 OVER SIZE 1 - SUB k DISP
  67.     NEXT
  68.   \>>
  69. \>>
  70.  
  71.  
  72. This is the HP48 version.  It is directly downloadable, of course.
  73. To start, press ROLL1.  The program will start up, and show 5 dice.
  74. Dice can be locked by pressing the corresponding menu button.  After
  75. the third throw, the dice cannot be locked anymore, and you can start over.
  76.  
  77. %%HP: T(3)A(R)F(,);
  78. DIR
  79.   ROLL1
  80.     \<< TEXT CLLCD PICT PURGE 6 10
  81.       FOR f f CF
  82.       NEXT 1 5
  83.       FOR I PICT I 26 * # 10h - { # 19h } + I 64 + CHR 1 \->GROB REPL
  84.       NEXT CSTL 'ROLL2' + roll
  85.     \>>
  86.   ROLL2
  87.     \<< CSTL 'ROLL3' + roll
  88.     \>>
  89.   ROLL3
  90.     \<< { { } { } { } { } { } ROLL1 } roll
  91.     \>>
  92.   roll
  93.     \<< 6 10
  94.       FOR f
  95.         IF f FC?
  96.         THEN PICT f 6 - # 1Ah * { # 0h } + FACES RAND 6 * 1 + IP GET REPL
  97.         END
  98.       NEXT MENU { # 0h # 0h } PVIEW 3 FREEZE
  99.     \>>
  100.   TOGGLE
  101.     \<< DUP 6 - # 1Ah * # 0h # 1Fh
  102.       IF 4 ROLL DUP FS?
  103.       THEN CF SWAP
  104.       ELSE SF
  105.       END PICT 4 PICK 4 PICK 2 \->LIST PICT 6 PICK 5 ROLL 2 \->LIST
  106.       4 PICK 4 PICK 8 ROLL # 17h + 8 ROLL # 17h + 2 \->LIST SUB REPL
  107.       # 18h # 18h BLANK REPL 3 FREEZE
  108.     \>>
  109.   CST { }
  110.   CSTL { { "A" \<< 6 TOGGLE \>> }
  111.     { "B" \<< 7 TOGGLE \>> }
  112.     { "C" \<< 8 TOGGLE \>> }
  113.     { "D" \<< 9 TOGGLE \>> }
  114.     { "E" \<< 10 TOGGLE \>> } }
  115.   FACES
  116.     \<< "{GROB 24 24 "
  117.     "FFFFFF10000810000810000810000810000810000810000810000810C308102408102408" +
  118.     "10240810240810C308100008100008100008100008100008100008100008100008FFFFFF" +
  119.     " GROB 24 24 " +
  120.     "FFFFFF100008970008580008580008580008580008970008100008100008100008100008" +
  121.     "1000081000081000081000081000E910001A10001A10001A10001A1000E9100008FFFFFF" +
  122.     " GROB 24 24 " +
  123.     "FFFFFF10000897000858000858000858000858000897000810000810C308102408102408" +
  124.     "10240810240810C3081000081000E910001A10001A10001A10001A1000E9100008FFFFFF" +
  125.     " GROB 24 24 " +
  126.     "FFFFFF1000089700E958001A58001A58001A58001A9700E9100008100008100008100008" +
  127.     "1000081000081000081000089700E958001A58001A58001A58001A9700E9100008FFFFFF" +
  128.     " GROB 24 24 " +
  129.     "FFFFFF1000089700E958001A58001A58001A58001A9700E910000810C308102408102408" +
  130.     "10240810240810C3081000089700E958001A58001A58001A58001A9700E9100008FFFFFF" +
  131.     " GROB 24 24 " +
  132.     "FFFFFF1000089700E958001A58001A58001A58001A9700E91000089700E958001A58001A" +
  133.     "58001A58001A9700E91000089700E958001A58001A58001A58001A9700E9100008FFFFFF" +
  134.     OBJ\-> DUP 'FACES' STO
  135.     \>>
  136. END
  137. --
  138. |                 | "Never imagine yourself not to be otherwise than what |
  139. | Jurjen N.E. Bos | it might appear to others that what you were or might |
  140. |                 | have been was not otherwise than what you had been    |
  141. |  jurjen@cwi.nl  | would have appeared to them to be otherwise."         |
  142.  
  143.  
  144.